#[derive(Debug, PartialEq)]
pub(crate) enum Method {
    GET,
    POST,
    PUT,
    DELETE,
    PATCH,
    OPTIONS,
    HEAD,
    CONNECT,
    TRACE,
    UNIDENTIFIED,
}

impl From<&str> for Method {
    fn from(s: &str) ->Method{
        match s {
            "GET"       => Method::GET,
            "POST"      => Method::POST,
            "PUT"       => Method::PUT,
            "DELETE"    => Method::DELETE,
            "PATCH"     => Method::PATCH,
            "OPTIONS"   => Method::OPTIONS,
            "HEAD"      => Method::HEAD,
            "CONNECT"   => Method::CONNECT,
            "TRACE"     => Method::TRACE,
            _ => Method::UNIDENTIFIED,
        }
    }
}
